<!DOCTYPE html>
<html lang="Zn-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小盒子社区</title>
    <style>
        :root {
            --primary-bg-color: #000;
            --secondary-bg-color: #1a1a1a;
            --text-color: #00ffcc;
            --link-color: #00ffcc;
            --card-bg-color: #222;
            --card-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
            --font-size: 16px;
            --transition-time: 0.3s;
        }

        [data-theme="light"] {
            --primary-bg-color: #f0f8ff;
            --secondary-bg-color: #e0f7fa;
            --text-color: #00796b;
            --link-color: #00796b;
            --card-bg-color: #fff;
            --card-shadow: 0 0 10px rgba(0, 121, 107, 0.3);
        }

        body {
            font-family: 'Roboto', sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--primary-bg-color);
            padding-bottom: 50px;
            color: var(--text-color);
            transition: background-color var(--transition-time) ease, color var(--transition-time) ease;
            font-size: var(--font-size);
        }

        a {
            text-decoration: none;
            margin-bottom: 10px;
            color: var(--link-color);
            transition: color var(--transition-time) ease;
        }

        nav {
            background-color: var(--secondary-bg-color);
            color: var(--text-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            position: sticky;
            top: 0;
            z-index: 100;
            width: 100%;
            box-sizing: border-box;
        }

        .menu-icon2 {
            font-size: 24px;
            cursor: pointer;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .dropdown {
            position: relative;
            background-color: var(--secondary-bg-color);
            color: var(--text-color);
            padding: 10px;
            cursor: pointer;
            border-radius: 5px;
            transition: background-color var(--transition-time) ease;
            margin-right: 10px;
        }

        .dropdown-content {
            display: none;
            background-color: var(--secondary-bg-color);
            color: var(--text-color);
            position: absolute;
            top: 100%;
            right: 0;
            width: 200px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            border-radius: 5px;
            z-index: 1000;
            transition: top var(--transition-time) ease;
        }

        .dropdown-content a {
            display: block;
            padding: 10px;
            text-decoration: none;
            color: var(--text-color);
            transition: background-color var(--transition-time) ease;
        }

        .dropdown-content a:hover {
            background-color: #333;
        }

        .dropdown.open .dropdown-content {
            display: block;
        }

        .container {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 30px 40px;
            padding: 20px;
            max-width: 1200px;
            margin: 0 auto;
            box-sizing: border-box;
        }

        /* 缩小卡片宽度 */
        .card {
            background-color: var(--card-bg-color);
            border-radius: 12px;
            padding: 0;
            box-shadow: var(--card-shadow);
            text-align: center;
            position: relative;
            overflow: hidden;
            aspect-ratio: 1/1; /* 强制正方形 */
        }
    /* 回退方案：兼容不支持 aspect-ratio 的浏览器 */
        .card::before {
            content: '';
            display: block;
            padding-top: 100%; /* 正方形比例 */
        }
        /* 缩小卡片内容 */
        .card img {
            position: absolute; /* 绝对定位图片 */
            top: 0; left: 0;
            max-width: 100%;
            object-fit: cover; /* 图片等比覆盖整个卡片 */
            height: auto;
            border-radius: 8px;
            height: 120px; /* 设置卡片高度 */
        }

        .card h3 {
            position: absolute;
            bottom: 5px; /* 靠近底部 */
            left: 0;
            right: 0;
            font-size: 14px;
            margin: 8px 0 0;
        }

        @media (max-width: 1024px) {
            .container {
                grid-template-columns: repeat(3, 1fr);
                gap: 25px 30px;
            }
        }

        @media (max-width: 768px) {
            .container {
                grid-template-columns: repeat(2, 1fr);
                gap: 20px 15px;
            }

            .card h3 {
                font-size: 13px;
            }
        }

        footer {
            background-color: var(--secondary-bg-color);
            color: var(--text-color);
            text-align: center;
            padding: 20px;
            width: 100%;
            clear: both;
            box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2);
        }

        .toolbox {
            display: flex;
            align-items: center;
        }

        .theme-toggle {
            background-color: transparent;
            border: none;
            color: var(--text-color);
            font-size: 24px;
            cursor: pointer;
            transition: color var(--transition-time) ease;
        }

        .theme-toggle:hover {
            color: #ccc;
        }

        h2 {
            text-align: center;
            margin-top: 30px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
    </style>
</head>
<body>
    <nav>
        <div class="menu-icon2">小盒子社区</div>
        <div class="toolbox">
            <div class="dropdown" onclick="toggleDropdown()">
                ☰
                <div class="dropdown-content">
                    <a href="">首页</a>
                    <a href="search">作品搜索</a>
                    <a href="user/{{ session['username'] }}">个人中心</a>
                    <a href="tougaoscratch">投稿作品</a>
                    <a href="upbook">投稿博客</a>
                    <a href="{{ url_for('logout') }}">登出</a>
                    <a href="users">用户更改</a>
                </div>
            </div>
            <button class="theme-toggle" onclick="toggleTheme()">&#9788;</button>
        </div>
    </nav>

    <h2>优秀作品喵~</h2>
    <div class="container">
        <a href="/scratch/{{ Excellent_scratch_1 }}" class="card">
            <img src="/scratchphoto={{ Excellent_scratch_1 }}" alt="封面">
            <h3>{{ Excellent_scratch_work_1 }}</h3>
        </a>
        <a href="/scratch/{{ Excellent_scratch_2 }}" class="card">
            <img src="/scratchphoto={{ Excellent_scratch_2 }}" alt="封面">
            <h3>{{ Excellent_scratch_work_2 }}</h3>
        </a>
        <a href="/scratch/{{ Excellent_scratch_3 }}" class="card">
            <img src="/scratchphoto={{ Excellent_scratch_3 }}" alt="封面">
            <h3>{{ Excellent_scratch_work_3 }}</h3>
        </a>
        <a href="/scratch/{{ Excellent_scratch_4 }}" class="card">
            <img src="/scratchphoto={{ Excellent_scratch_4 }}" alt="封面">
            <h3>{{ Excellent_scratch_work_4 }}</h3>
        </a>
        <a href="/scratch/{{ Excellent_scratch_5 }}" class="card">
            <img src="/scratchphoto={{ Excellent_scratch_5 }}" alt="封面">
            <h3>{{ Excellent_scratch_work_5 }}</h3>
        </a>
        <a href="/scratch/{{ Excellent_scratch_6 }}" class="card">
            <img src="/scratchphoto={{ Excellent_scratch_6 }}" alt="封面">
            <h3>{{ Excellent_scratch_work_6 }}</h3>
        </a>
    </div>

    <h2>发现佳作喵~</h2>
    <div class="container">
        <a href="/scratch/{{ scid1 }}" class="card">
            <img src="/scratchphoto={{ scid1 }}" alt="">
            <h3>{{ zhuopin1 }}</h3>
        </a>
        <a href="/scratch/{{ scid2 }}" class="card">
            <img src="/scratchphoto={{ scid2 }}" alt="">
            <h3>{{ zhuopin2 }}</h3>
        </a>
        <a href="/scratch/{{ scid3 }}" class="card">
            <img src="/scratchphoto={{ scid3 }}" alt="">
            <h3>{{ zhuopin3 }}</h3>
        </a>
        <a href="/scratch/{{ scid4 }}" class="card">
            <img src="/scratchphoto={{ scid4 }}" alt="">
            <h3>{{ zhuopin4 }}</h3>
        </a>
        <a href="/scratch/{{ scid5 }}" class="card">
            <img src="/scratchphoto={{ scid5 }}" alt="">
            <h3>{{ zhuopin5 }}</h3>
        </a>
        <a href="/scratch/{{ scid6 }}" class="card">
            <img src="/scratchphoto={{ scid6 }}" alt="">
            <h3>{{ zhuopin6 }}</h3>
        </a>
    </div>
    <h2>发现新作喵~</h2>
    <div class="container">
        <a href="/scratch/{{ scid7 }}" class="card">
            <img src="/scratchphoto={{ scid7 }}" alt="">
            <h3>{{ zhuopin7 }}</h3>
        </a>
        <a href="/scratch/{{ scid8 }}" class="card">
            <img src="/scratchphoto={{ scid8 }}" alt="">
            <h3>{{ zhuopin8 }}</h3>
        </a>
        <a href="/scratch/{{ scid9 }}" class="card">
            <img src="/scratchphoto={{ scid9 }}" alt="">
            <h3>{{ zhuopin9 }}</h3>
        </a>
        <a href="/scratch/{{ scid10 }}" class="card">
            <img src="/scratchphoto={{ scid10 }}" alt="">
            <h3>{{ zhuopin10 }}</h3>
        </a>
        <a href="/scratch/{{ scid11 }}" class="card">
            <img src="/scratchphoto={{ scid11 }}" alt="">
            <h3>{{ zhuopin11 }}</h3>
        </a>
        <a href="/scratch/{{ scid12 }}" class="card">
            <img src="/scratchphoto={{ scid12 }}" alt="">
            <h3>{{ zhuopin12 }}</h3>
        </a>
    </div>

    <footer>
        <p>2025 小盒子社区</p>
        <p>代理官方：<a href="https://space.bilibili.com/3493133419546943?spm_id_from=333.1296.0.0">bilibili</a></p>
        网站相关 <a href = "/required">使用小盒子必读</a> | <a href = "/advise">提交创意</a> | <a href="/download">下载相关软件</a> | <a href="https://baike.baidu.com/item/%E4%BA%92%E8%81%94%E7%BD%91%E7%AB%99%E7%A6%81%E6%AD%A2%E4%BC%A0%E6%92%AD%E6%B7%AB%E7%A7%BD%E3%80%81%E8%89%B2%E6%83%85%E7%AD%89%E4%B8%8D%E8%89%AF%E4%BF%A1%E6%81%AF%E8%87%AA%E5%BE%8B%E8%A7%84%E8%8C%83">互联网自律公约</a><br>
        常用网站 <a href = "https://donvie.top">donvie</a> | <a href = "https://www.rainyun.com/NzMxMjkw_">雨云</a><br>
        特别鸣谢 <a href = "https://space.bilibili.com/3493133419546943">吾家小狐(提供主要代码)</a> | <a href="https://space.bilibili.com/1120402022">Donvies(前端支持)</a> | <a href="https://space.bilibili.com/1128177448">yangyi(服务器支持)</a><br>
        解决方案 <a href = "/ad">广告推广</a>
        <p>QQ交流群：1037989684</p>
    </footer>

    <script>
        function toggleDropdown() {
            const dropdown = document.querySelector('.dropdown');
            dropdown.classList.toggle('open');
        }

        function toggleTheme() {
            const html = document.documentElement;
            if (html.getAttribute('data-theme') === 'light') {
                html.removeAttribute('data-theme');
            } else {
                html.setAttribute('data-theme', 'light');
            }
        }

        document.addEventListener('click', function (event) {
            const dropdown = document.querySelector('.dropdown');
            if (!dropdown.contains(event.target)) {
                dropdown.classList.remove('open');
            }
        });
        console.info('加载成功，小盒子版本号：1.7.6');
        console.info('未修改前端');
    </script>
</body>
</html>